<div class="admin_page">
  <h1 class="admin-page-title"><%= message('dashboard.global_dashboards') -%></h1>
  <p class="admin-page-description"><%= message('dashboard.global_dashboards.description') -%></p>

  <%= render :partial => 'list', :locals => {:active_dashboards => @actives.select(&:global?), :group => 'activeGlobal'} %>

  <h1 class="admin-page-title"><%= message('dashboard.project_dashboards') -%></h1>
  <p class="admin-page-description"><%= message('dashboard.project_dashboards.description') -%></p>

  <%= render :partial => 'list', :locals => {:active_dashboards => @actives.reject(&:global?), :group => 'activeProject'} %>

  <h1 class="admin-page-title"><%= message('dashboard.shared_dashboards') -%></h1>
  <p class="admin-page-description"><%= message('dashboard.shared_dashboards.description') -%></p>

  <table class="data" id="shared">
    <thead>
    <tr>
      <th class="name"><%= message('name') -%></th>
      <th class="owner"><%= message('shared_by') -%></th>
      <th class="global"><%= message('global') -%></th>
      <th class="operations"><%= message('operations') -%></th>
    </tr>
    </thead>
    <tbody>
    <% if @shared_dashboards.empty? %>
      <tr class="even">
        <td colspan="4"><%= message('dashboard.no_dashboard') -%></td>
      </tr>
    <% else %>
      <% @shared_dashboards.each do |dashboard| %>
        <tr class="<%= cycle('even', 'odd') -%>">
          <td>
            <div><%= h(dashboard.name(true)) -%></div>
            <div class="description"><%= dashboard.description -%></div>
          </td>
          <td class="owner">
            <%= h(dashboard.user_name || message('dashboard.username.default')) -%>
          </td>
          <td class="global">
            <%= boolean_icon(dashboard.global) -%>
          </td>
          <td class="thin nowrap operations">
            <%= link_to 'Add to defaults', {:action => 'add', :id => dashboard.id}, {:method => :post, :id => "add-#{u dashboard.name}", :class => 'link-action'} %>
          </td>
        </tr>
      <% end %>
    <% end %>
    </tbody>
  </table>
</div>

